package com.xszx.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xszx.entity.TRecord;
import com.xszx.entity.dto.RecordDTO;
import com.xszx.service.TRecordService;
import com.xszx.mapper.TRecordMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
* @author 34129
* @description 针对表【t_record】的数据库操作Service实现
* @createDate 2024-01-08 20:40:47
*/
@Service
public class TRecordServiceImpl extends ServiceImpl<TRecordMapper, TRecord>
    implements TRecordService{

    @Autowired
    private TRecordMapper recordMapper;

    @Override
    public List<RecordDTO> selectRecording(long did) {
        return recordMapper.selectRecording(did);
    }

    @Override
    public List<TRecord> selectRecordings() {
        return recordMapper.selectRecordings();
    }


    @Override
    public int updateRecord(TRecord record) {
        int i = recordMapper.updateById(record);
        return i;
    }

    @Override
    public int updateStatus( RecordDTO record) {
        int i = recordMapper.updateStatus(record);
        System.out.println(i);
        return i;
    }


    @Override
    public RecordDTO getRecordDTOByRid(Long rid) {
           RecordDTO recordDTO =  recordMapper.getRecordDTOByRid(rid);
        return recordDTO;
    }

    @Override
    public int insertRecordDtro(TRecord record) {
        return recordMapper.insert(record);
    }
}




